import request from '@/utils/request'

// 查询角色信息列表
export function listJuese(query) {
  return request({
    url: '/sxt/juese/list',
    method: 'get',
    params: query
  })
}

// 查询角色信息详细
export function getJuese(roleId) {
  return request({
    url: '/sxt/juese/' + roleId,
    method: 'get'
  })
}

// 新增角色信息
export function addJuese(data) {
  return request({
    url: '/sxt/juese',
    method: 'post',
    data: data
  })
}

// 修改角色信息
export function updateJuese(data) {
  return request({
    url: '/sxt/juese',
    method: 'put',
    data: data
  })
}

// 删除角色信息
export function delJuese(roleId) {
  return request({
    url: '/sxt/juese/' + roleId,
    method: 'delete'
  })
}

// 查询角色已授权用户列表
export function allocatedUserList(query) {
  return request({
    url: '/sxt/juese/juese_yonghu_list',
    method: 'get',
    params: query
  })
}

// 查询角色已授权剩余用户列表
export function notAllocatedUserList(query) {
  return request({
    url: '/sxt/juese/shengyu',
    method: 'get',
    params: query
  })
}

// 为角色分配用户
export function addYonghuJuese(query) {
  return request({
    url: '/sxt/juese/fen_pei_yong_hu',
    method: 'get',
    params: query
  })
}

// 取消用户授权角色
export function authUserCancel(data) {
  return request({
    url: '/sxt/juese/authUser/cancel',
    method: 'put',
    data: data
  })
}
